package com.jxl.utils;

import com.alibaba.fastjson.JSON;
import com.jxl.web.WebResult;

import javax.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

import static java.lang.System.out;

/**
 * Web工具
 * @author 江雪林
 * @create 2021-03-31
 */
public class WebUtils {
    public static void response(HttpServletResponse response, WebResult webResult) throws IOException {
        PrintWriter out = response.getWriter();
        out.print(JSON.toJSONString(webResult));
        out.flush();
        out.close();
    }
}
